package philosoph;

import java.io.Serializable;

public class StdPhilosoph implements Philosoph, Serializable {
	private static final long serialVersionUID = -380076558962345342L;

	private int thinkTime;
	private int eatTime;
	private final String name;

	public StdPhilosoph(int thinkTime, int eatTime, String name) {
		this.thinkTime = thinkTime;
		this.eatTime = eatTime;
		this.name = name;
	}

	@Override
	public void think() throws InterruptedException {
		Thread.sleep(this.thinkTime);
	}

	@Override
	public void eat() throws InterruptedException {
		Thread.sleep(this.eatTime);
	}

	@Override
	public boolean equals(Object obj) {
		return this == obj; // for speed reasons
	}

	@Override
	public String getName() {
		return this.name;
	}

}
